package day11.Exer;

public class Teachertest {
    public static void main(String[] args) throws Exception {
        try{
            Teacher a=new Teacher("张老师","安大",20);
            if(a.getAge()<=22){
                throw new Exception("年龄不合格");
            }
        a.introductSelf();
        a.giveLesson();}catch (Exception e){
            System.out.println(e.getMessage());
        }
    }
}
